package com.jialea.luobochat.common.utils.file;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 文件路径工具类
 * @author: wf
 * @date: 2024/10/19 23:00
 */
public class FilePathUtils {

    /**
     * 构建图片文件路径
     * @param filename
     * @param filename yyyy/mm/dd/file.jpg
     * @return
     */
    public static String builderFilePath(String filename) {
        StringBuilder stringBuilder = new StringBuilder(50);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
        String todayStr = sdf.format(new Date());
        stringBuilder.append(todayStr).append("/");
        stringBuilder.append(filename);
        return stringBuilder.toString();
    }
}
